using GooglePlayGames;
using UnityEngine;

public class GooglePlayInitializer : MonoBehaviour
{
	private void Start()
	{
		PlayGamesPlatform.DebugLogEnabled = false;
	}

	public void ActivateGooglePlay()
	{
		PlayGamesPlatform.Activate();
		Social.localUser.Authenticate(delegate(bool success)
		{
			if (success)
			{
				UnityEngine.Debug.Log("Logged in to Google Play Games");
				PlayerPrefs.SetInt("GPG", 1);
				AchievementsManager.UnlockAchievement("CgkI3_DHnsgeEAIQAg");
			}
			else
			{
				UnityEngine.Debug.Log("Failed to log in to Google Play Games");
				PlayerPrefs.DeleteKey("GPG");
			}
			PlayerPrefs.Save();
		});
	}

	public void DisableGooglePlay()
	{
		PlayerPrefs.SetInt("GPG", 0);
		PlayerPrefs.Save();
	}
}
